<?php
/**
 * 배추 모바일 빌더 (Mobile for Gnuboard4)
 *
 * Copyright (c) 2010 Choi Jae-Young <www.miwit.com>
 *
 * 저작권 안내
 * - 저작권자는 이 프로그램을 사용하므로서 발생하는 모든 문제에 대하여 책임을 지지 않습니다. 
 * - 이 프로그램을 어떠한 형태로든 재배포 및 공개하는 것을 허락하지 않습니다.
 * - 이 저작권 표시사항을 저작권자를 제외한 그 누구도 수정할 수 없습니다.
 */

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

$mw_is_view = true;

$tmp_skin_path = $board_skin_path;
$pc_skin_path = "$g4[path]/skin/board/$board[bo_skin]";
$board_skin_path = $pc_skin_path;
if (file_exists("$pc_skin_path/mw.lib/mw.skin.basic.lib.php"))
    include_once("$pc_skin_path/mw.lib/mw.skin.basic.lib.php");
$board_skin_path = $tmp_skin_path;

$board[bo_image_width] = 280;

if ($mw_basic['cf_watermark_path'])
    $mw_basic['cf_watermark_path'] = "../".$mw_basic['cf_watermark_path'];

include("$pc_skin_path/view_head.skin.php");

if ($write['wr_key_password'] && !get_session($ss_key_name."_".$write['wr_id'])) {
    include("{$pc_skin_path}/mw.proc/mw.key.php");
    return;
}

for ($i=1; $i<=$g4[link_count]; $i++) {
    if ($view[link][$i]) {
        $view[link_href][$i] = "$mw_mobile[path]/link.php?bo_table=$bo_table&wr_id=$wr_id&no=$i";
    }
}

if ($delete_href && !$is_member)
    $delete_href = "del('$delete_href')";
?>

<script type="text/javascript" src="<?="$pc_skin_path/mw.js/mw_image_window.js"?>"></script>

<link rel="stylesheet" href="<?=$board_skin_path?>/style.common.css" type="text/css">
<style type="text/css">
#mw_mobile .board_view {
    list-style:none;
    margin:5px;
    padding:5px;
    box-shadow: 0 1px #EBEBEB;
    border-radius: 3px;
    border: 1px solid;
    border-color: #E5E5E5 #D3D3D3 #B9C1C6;
    background-color:#fff;
}
#mw_mobile .write_subject { font-size:15px; font-weight:bold; padding:5px 0 10px 5px; border-bottom:1px solid #ddd; }

#mw_mobile .write_info { font-size:11px; color:#aaa; margin:5px 5px 0 0; text-align:right; }
#mw_mobile .write_info .write_name { font-size:12px; color:#444; font-weight:bold; }
#mw_mobile .write_info .write_date { font-size:12px; color:#444; }
#mw_mobile .write_info .write_hit { font-size:12px; color:#444; }

#mw_mobile .write_down { margin:5px 0 0 0;  }
#mw_mobile .write_down a { color:#888; }

#mw_mobile .write_link { margin:5px 0 0 0;  }
#mw_mobile .write_link a { color:#888; }

#mw_mobile .write_content { padding:10px 0 0 5px; }
#mw_mobile .write_good { text-align:center; margin:20px 0 0 0; clear:both; }

#mw_mobile .board_button { text-align:center; margin:20px 0 20px 0; }

#mw_mobile .move_link { margin:10px 0 0 0; border-top:1px solid #ddd; }
#mw_mobile .move_link .prev_link { margin:0; border-bottom:1px solid #ddd; }
#mw_mobile .move_link .prev_link a { display:block; padding:10px 0 10px 5px; }
#mw_mobile .move_link .next_link { margin:0; border-bottom:1px solid #ddd; }
#mw_mobile .move_link .next_link a { display:block; padding:10px 0 10px 5px; }

/* 신고 */
#mw_mobile .singo_info { color:#FF6600; color:#444; margin:0 0 20px 0; }
#mw_mobile .btn_singo_block { cursor:pointer; color:#888; color:#FF6600; font-weight:bold; /*font-size:11px; margin:0 0 0 10px;*/ text-decoration:underline; }
#mw_mobile .singo_block { display:none; } 
</style>

<script type="text/javascript" src="<?=$pc_skin_path?>/mw.js/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="<?=$pc_skin_path?>/mw.js/syntaxhighlighter/scripts/shBrushPhp.js"></script>
<link type="text/css" rel="stylesheet" href="<?=$pc_skin_path?>/mw.js/syntaxhighlighter/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="<?=$pc_skin_path?>/mw.js/syntaxhighlighter/styles/shThemeMidnight.css"/>
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '<?=$pc_skin_path?>/mw.js/syntaxhighlighter/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>

<div class="board_view">
<div class="write_subject">
    <? if ($mw_basic[cf_attribute] == 'qna' && !$view[is_notice]) { ?>
    <img src="<?=$board_skin_path?>/img/icon_qna_<?=$view[wr_qna_status]?>.png" align="absmiddle"></span> <?}?>
    <? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
    <?=cut_hangul_last(get_text($view[wr_subject]))?>
</div> 
<div class="write_info">
    <? if ($mw_basic[cf_attribute] != "anonymous") { ?>
      <span class="write_name">by <?=$view[name]?></span> | 
    <? } ?>
    <span class="write_date"><?=date("y.m.d H:i", strtotime($view[wr_datetime]))?></span>
    | <span class="write_hit"><?=number_format($view[wr_hit])?> hit</span>
</div>

<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
    if ($view[file][$i][source] && !$view[file][$i][view] && !$view[file][$i][movie]) {
        $cnt++;

    $view[file][$i][href] = str_replace('./', $mw_mobile['path'].'/', $view[file][$i][href]);
?>
<div class="write_down">
    <a href="javascript:file_download('<?=$view[file][$i][href]?>', '<?=addslashes($view[file][$i][source])?>', '<?=$i?>');" title="<?=$view[file][$i][content]?>">
    <img src="<?=$board_skin_path?>/img/icon_file_down.gif" align=absmiddle>
    <?=$view[file][$i][source]?></a>
    <span class=mw_basic_view_file_info> (<?=$view[file][$i][size]?>), Down : <?=$view[file][$i][download]?>, <?=$view[file][$i][datetime]?></span>
</div>
<?
    }
}

// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
    if ($view[link][$i]) {
        $cnt++;
        $link = cut_str($view[link][$i], 30);
        echo "<div class=\"write_link\">";
        echo "<a href='{$view[link_href][$i]}' target=_blank>{$link}</a>";
        echo "&nbsp;<span style=\"color:#ff6600; font-size:11px;\">[{$view[link_hit][$i]}]</span>";
        echo "</div>";
    }
}
?>

<?
$bomb = sql_fetch(" select * from $mw[bomb_table] where bo_table = '$bo_table' and wr_id = '$wr_id' ");
if ($bomb) {
?>
    <div class="mw_basic_view_bomb">
    <img src="<?=$board_skin_path?>/img/icon_bomb.gif" align="absmiddle">&nbsp;
    이 게시물이 자동 폭파되기까지 <span id="bomb_end_timer"></span> 남았습니다.
    </div>
    <script type="text/javascript">
    var bomb_end_time = <?=(strtotime($bomb[bm_datetime])-$g4[server_time])?>;
    function bomb_run_timer()
    {
        var timer = document.getElementById("bomb_end_timer");

        dd = Math.floor(bomb_end_time/(60*60*24));
        hh = Math.floor((bomb_end_time%(60*60*24))/(60*60));
        mm = Math.floor(((bomb_end_time%(60*60*24))%(60*60))/60);
        ii = Math.floor((((bomb_end_time%(60*60*24))%(60*60))%60));

        var str = "";

        if (dd > 0) str += dd + "일 ";
        if (hh > 0) str += hh + "시간 ";
        if (mm > 0) str += mm + "분 ";
        str += ii + "초 ";

        //timer.style.color = "#FF6C00";
        timer.style.color = "#FF0000";
        timer.style.fontWeight = "bold";
        timer.innerHTML = str;

        bomb_end_time--;

        if (bomb_end_time <= 0)  {
            clearInterval(bomb_tid);
            location.href = "<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>";
        }
    }
    bomb_run_timer();
    bomb_tid = setInterval('bomb_run_timer()', 1000); 
    </script>
<? } ?>


<!-- 내용 출력 -->
<? if (file_exists("$mw_mobile[path]/ad-top.php")) include("$mw_mobile[path]/ad-top.php"); ?>

<div class="write_content"><?=$view[rich_content]?></div>

<? if (file_exists("$mw_mobile[path]/ad-bottom.php")) include("$mw_mobile[path]/ad-bottom.php"); ?>

<? if ($mw_basic[cf_google_map] && trim($write[wr_google_map]) && !$google_map_is_view && $google_map_code) { ?>
<div>
        <?=$google_map_code?>
</div>
<? } ?>

<?php
if (!$ob_marketdb_flag) echo $ob_marketdb;
?>

<? if ($mw_basic[cf_ccl] && $view[wr_ccl][by]) { ?>
<div class="mw_basic_ccl">
<a rel="license" href="<?=$view[wr_ccl][link]?>" title="<?=$view[wr_ccl][msg]?>" target=_blank>
<img src="<?=$pc_skin_path?>/mw.ccl/ccls_by.gif">
<? if ($view[wr_ccl][nc] == "nc") { ?><img src="<?=$pc_skin_path?>/mw.ccl/ccls_nc.gif"><? } ?>
<? if ($view[wr_ccl][nd] == "nd") { ?><img src="<?=$pc_skin_path?>/mw.ccl/ccls_nd.gif"><? } ?>
<? if ($view[wr_ccl][nd] == "sa") { ?><img src="<?=$pc_skin_path?>/mw.ccl/ccls_sa.gif"><? } ?>
</a>
</div>
<? } ?>

<div class="sns"><?=$view_sns?></div>

<div class="write_good">
    <?php if ($board[bo_use_good] || $board[bo_use_nogood]) { // 추천, 비추천?>
        <div id="mw_good"></div>
    <?php } ?>

    <? if ($is_member && $singo_href) { ?>
        <input type="button" class="btn btn-default btn-sm" value="신고" onclick="<?=$singo_href?>">
    <? } ?>
    <? if ($is_admin && $view[mb_id] != $member[mb_id]) {  ?>
        <input type="button" class="btn btn-default btn-sm" value="차단" onclick="btn_intercept('<?=$view[mb_id]?>')"> 
    <? } ?>
</div>

<?  if ($mw_basic[cf_quiz]) { // 퀴즈 ?>
<div class=mw_basic_view_quiz>
    <div id="mw_quiz"></div>
    <script>
    function mw_quiz_load() {
        $.get("<?=$quiz_path?>/view.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&is_mobile=1", function (data) {
            $("#mw_quiz").html(data);
        });
    }
    mw_quiz_load();
    </script>
</div>
<? } ?>

<?  if ($mw_basic[cf_vote]) { // 설문 ?>
<div class=mw_basic_view_vote>
    <div id="mw_vote"></div>

    <script type="text/javascript">
    function mw_vote_load() {
        $.get("<?=$board_skin_path?>/mw.proc/mw.vote.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&width=200", function (data) {
            $("#mw_vote").html(data);
        });
    }
    function mw_vote_result() {
        $.get("<?=$board_skin_path?>/mw.proc/mw.vote.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&result_view=1&width=200", function (data) {
            $("#mw_vote").html(data);
        });
    }
    function mw_vote_join() {
        var is_check = false;
        var vt_num = $("input[name='vt_num']");
        var choose = '';
        for (i=0; i<vt_num.length; i++)  {
            if (vt_num[i].checked) {
                is_check = true;
                choose += i + ',';
            }
        }
        if (!is_check) {
            alert("설문항목을 선택해주세요.");
            return;
        }
        $.get("<?=$board_skin_path?>/mw.proc/mw.vote.join.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&vt_num="+choose, function (data) {
            alert(data);
            mw_vote_load();
        });
    }
    mw_vote_load();
    </script>
</div>
<? } ?>

<? //if ($is_signature) { echo "<div>$signature</div>"; } // 서명 출력 ?>

<?
if ($mw_basic[cf_attribute] == 'qna' && !$view[is_notice]) {
    $qna_save_point = round($write[wr_qna_point]*round($mw_basic[cf_qna_save]/100,2));
    $qna_total_point = $qna_save_point + $mw_basic[cf_qna_point_add];
    $uname = $board[bo_use_name] ? $member[mb_name] : $member[mb_nick];
?>
<div class="mw_basic_qna_info">
    <? if ($is_member) { ?> <div><span class="mb_id"><?=$uname?></span>님의 지식을 나누어 주세요!</div> <? } ?>
    <div class="info2">
        <? if ($write[wr_qna_point]) { ?> 질문자가 자신의 포인트 <span class="num"><b><?=$write[wr_qna_point]?></b></span> 점을 걸었습니다.<br/> <? } ?>
        답변하시면 포인트 <span class="num"><b><?=$board[bo_comment_point]?></b>점</span>을<? if ($qna_total_point) { ?>, 답변이 채택되면
        포인트 <span class="num"><b><?=$qna_total_point?></b>점 <? } ?>
        <? if ($mw_basic[cf_qna_point_add]) { ?>
            (채택 <b><?=$qna_save_point?></b> + 추가 <b><?=$mw_basic[cf_qna_point_add]?></b>) <? } ?></span>을 드립니다.
    </div>
</div>
<? } ?>

<? if ($mw_basic[cf_related] && $view[wr_related]) { ?>
<? $rels = mw_related($view[wr_related]); ?>
<? if (count($rels)) {?>
<? if ($mw_basic[cf_related_table]) $bo_table2 = $mw_basic[cf_related_table]; else $bo_table2 = $bo_table; ?>
<div class=mw_basic_view_related>
    <h3>
        관련글
        <a href="board.php?bo_table=<?=$bo_table2?>&sfl=wr_subject||wr_content,1&sop=or&stx=<?=urlencode(str_replace(",", " ", $view[wr_related]))?>">[더보기]</a>
    </h3>
</div>
<div class="mw_basic_view_content mw_basic_view_related">
    <ul>
    <? for ($i=0; $i<count($rels); $i++) { ?>
    <li> <a href="<?=$rels[$i][href]?>">[<?=substr($rels[$i][wr_datetime], 0, 10)?>] <?=$rels[$i][subject]?> <?=$rels[$i][comment]?></a> </li>
    <? } ?>
    </ul>
</div>
<? } ?>
<? } ?>

<? if ($mw_basic[cf_latest]) { ?>
<? $latest = mw_view_latest(); ?>
<? if (count($latest)) {?>
<?
$bo_subject = $board[bo_subject];
if ($mw_basic[cf_latest_table]) {
    $tmp = sql_fetch("select bo_subject from $g4[board_table] where bo_table = '$mw_basic[cf_latest_table]'");
    $bo_subject = $tmp[bo_subject];
}
?>
<div class=mw_basic_view_latest>
    <h3>
        <?=$view[name]?> 님의 <?=$bo_subject?> 최신글
        <a href="board.php?bo_table=<?=$bo_table?>&sfl=mb_id,1&stx=<?=$write[mb_id]?>">[더보기]</a>
    </h3>
</div>
<div class="mw_basic_view_content mw_basic_view_latest">
    <ul>
    <? for ($i=0; $i<count($latest); $i++) { ?>
    <li> <a href="<?=$latest[$i][href]?>">[<?=substr($latest[$i][wr_datetime], 0, 10)?>] <?=$latest[$i][subject]?> <?=$latest[$i][comment]?></a> </li>
    <? } ?>
    </ul>
</div>
<? } ?>
<? } ?>

<?
// 코멘트 입출력
if (!$view[wr_comment_hide] && ($mw_basic[cf_comment_level] <= $member[mb_level])) {
    include_once("./view_comment.php");
}
?>

<div class="board_button">
    <? if ($write_href) { ?> <input type="button" class="btn btn-default btn-sm" value="글쓰기" onclick="location.href='<?=$write_href?>'"> <? } ?>
    <? if ($reply_href) { ?> <input type="button" class="btn btn-default btn-sm" value="답글" onclick="location.href='<?=$reply_href?>'"> <? } ?>
    <? if ($update_href) { ?> <input type="button" class="btn btn-default btn-sm" value="수정" onclick="location.href='<?=$update_href?>'"> <? } ?>
    <? if ($delete_href) { ?> <input type="button" class="btn btn-default btn-sm" value="삭제" onclick="<?=$delete_href?>"> <? } ?>
    <input type="button" class="btn btn-default btn-sm" value="목록으로"
        onclick="location.href='<?php echo mw_seo_url($bo_table, 0, $qstr)?>'">
</div>

<div class="move_link">
    <?
    $prev_wr_subject = bc_code($prev_wr_subject, 0);
    $prev_wr_subject = mw_reg_str($prev_wr_subject);

    $next_wr_subject = bc_code($next_wr_subject, 0);
    $next_wr_subject = mw_reg_str($next_wr_subject);

    if ($prev_href) { 
        echo "<div class='prev_link'>";
        echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\" style='display:block;'>이전글 : $prev_wr_subject</a></div>";
    } 
    if ($next_href) {
        echo "<div class='next_link'>";
        echo "<a href=\"$next_href\" title=\"$next_wr_subject\" style='display:block'>다음글 : $next_wr_subject</a></div>";
    }
    ?>
    </div>
</div>

<div> <!-- board_view -->

<script type="text/javascript">
function file_download(link, file, no) {
    <?
    if ($member[mb_level] < $board[bo_download_level]) {
        $alert_msg = "다운로드 권한이 없습니다.";
        if ($member[mb_id]) { 
            echo "alert('$alert_msg'); return;\n";
        } else {
            echo "alert('$alert_msg\\n\\n회원이시라면 로그인 후 이용해 보십시오.');\n";
            echo "location.href = './login.php?wr_id=$wr_id$qstr&url=".urlencode("$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id")."';\n";
            echo "return;";
        }
    }
    ?>

    <? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>

    document.location.href=link;
}
</script>

<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>

<? if ($is_admin) { ?>
<script type="text/javascript">
function btn_now() {
    var renum = 0;
    if (confirm("이 게시물의 작성시간을 현재로 변경하시겠습니까?")) {
        if (confirm("날짜순으로 정렬 하시겠습니까?")) renum = 1;

        $.get("<?=$board_skin_path?>/mw.proc/mw.time.now.php", { "bo_table":"<?=$bo_table?>", "wr_id":"<?=$wr_id?>", "renum":renum }, function () {
            location.reload();
        });
    }
}
function btn_intercept(mb_id) {
    win_open("<?=$board_skin_path?>/mw.proc/mw.intercept.php?bo_table=<?=$bo_table?>&mb_id=" + mb_id, "intercept", "width=500,height=300,scrollbars=yes");
}
function btn_ip(ip) {
    win_open("<?=$board_skin_path?>/mw.proc/mw.whois.php?ip=" + ip, "whois", "width=700,height=600,scrollbars=yes");
}
function btn_ip_search(ip) {
    location.href = "<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&sfl=wr_ip&stx=" + ip;
}
function btn_notice() {
    var is_off = 0;
    <? if ($view[is_notice]) { ?>
    if (!confirm("이 공지를 내리시겠습니까?")) return;
    is_off = 1; 
    <? } else { ?>
    if (!confirm("이 글을 공지로 등록하시겠습니까?")) return;
    <? } ?>
    $.get("<?=$board_skin_path?>/mw.proc/mw.notice.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&is_off="+is_off, function(data) {
        alert(data);
    });
}
function btn_popup() {
    var is_off = 0;
    <? if ($is_popup) { ?>
    if (!confirm("이 팝업공지를 내리시겠습니까?")) return;
    is_off = 1; 
    <? } else { ?>
    if (!confirm("이 글을 팝업공지로 등록하시겠습니까?")) return;
    <? } ?>
    $.get("<?=$board_skin_path?>/mw.proc/mw.popup.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>", function(data) {
        alert(data);
    });
}
function btn_comment_hide() {
    var is_off = 0;
    <? if (!$view[wr_comment_hide]) { ?>
    if (!confirm("이 글의 댓글을 감추시겠습니까?")) return;
    is_off = 1; 
    <? } else { ?>
    if (!confirm("이 글의 댓글을 보이시겠습니까?")) return;
    <? } ?>
    $.get("<?=$board_skin_path?>/mw.proc/mw.comment.hide.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&is_off="+is_off, function(data) {
        alert(data);
        location.reload();
    });
}
</script>
<? } ?>


<? if ($singo_href) { ?>
<script type="text/javascript">
function btn_singo(wr_id, parent_id) {
    //if (confirm("이 게시물을 정말 신고하시겠습니까?")) {
    //hiddenframe.location.href = "<?=$board_skin_path?>/mw.proc/mw.btn.singo.php?bo_table=<?=$bo_table?>&wr_id=" + wr_id + "&parent_id=" + parent_id;
    win_open("<?=$board_skin_path?>/mw.proc/mw.btn.singo.php?bo_table=<?=$bo_table?>&wr_id=" + wr_id + "&parent_id=" + parent_id, "win_singo", "width=500,height=300,scrollbars=yes");
    //}
}
function btn_singo_view(wr_id) {
    var id = "singo_block_" + wr_id;

    if (document.getElementById(id).style.display == 'block')
        document.getElementById(id).style.display = 'none';
    else
        document.getElementById(id).style.display = 'block';
}

function btn_singo_clear(wr_id) {
    if (confirm("정말 초기화 하시겠습니까?")) {
        $.get("<?=$board_skin_path?>/mw.proc/mw.btn.singo.clear.php?bo_table=<?=$bo_table?>&wr_id="+wr_id, function(msg) {
            alert(msg);
        });
    }
}
</script>
<? } ?>

<script type="text/javascript">
//$(document).ready (function() { resizeBoardImage(<?=$board[bo_image_width]?>); });
function btn_singo_view(wr_id) {
    var id = "singo_block_" + wr_id;

    if (document.getElementById(id).style.display == 'block')
        document.getElementById(id).style.display = 'none';
    else
        document.getElementById(id).style.display = 'block';
}


</script>
<!-- 게시글 보기 끝 -->

<link type="text/css" href="<?=$pc_skin_path?>/mw.js/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
<script src="<?=$pc_skin_path?>/mw.js/jquery-ui-1.8.19.custom.min.js"></script>

<script>
function mw_good_load() {
    $.get("<?=$pc_skin_path?>/mw.proc/mw.good.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&width=150", function (data) {
        $("#mw_good").html(data);
    });
}
function mw_good_act(good) {
    $.get("<?=$pc_skin_path?>/mw.proc/mw.good.act.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&good="+good, function (data) {
        alert(data);
        mw_good_load();
    });
}
function mw_good_act_nocancel(good) {
    $.get("<?=$pc_skin_path?>/mw.proc/mw.good.act.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>&good="+good+"&no_cancel=1", function (data) {
        alert(data);
        mw_good_load();
    });
}
mw_good_load();
</script>

<?php

// 팝업공지
$sql = "select * from $mw[popup_notice_table] where bo_table = '$bo_table' order by wr_id desc";
$qry = sql_query($sql, false);
while ($row = sql_fetch_array($qry)) {
    $row2 = sql_fetch("select * from $write_table where wr_id = '$row[wr_id]'");
    if (!$row2) {
        sql_query("delete from $mw[popup_notice_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]'");
        continue;
    }
    $view = get_view($row2, $board, $board_skin_path, 255);
    mw_board_popup($view, $html);
}

